Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Proposal] Correctly encode/decode multi level type hierarchy with multiple labels. #1728

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

eneim
Copy link

@eneim eneim commented Aug 24, 2023

This PR is a work in progress. However, I would like to share the proposal first, and complete it (or postpone it) depending on the feedback.

This PR is a proposal to fix the two issues above (there are more relevant issues, so it has a high demand). The work mainly benefits the toJson part because fromJson works correctly.

The idea is to fetch through the type hierarchy to find the non-PolymorphicJsonAdapter instance and record the label information throughout the search. Lastly, it writes the recorded labels of the ancestor types before using the actual JsonAdapter to complete writing the JSON.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant